package com.note.es.mapping;

import java.lang.reflect.Field;
import java.util.HashSet;
import java.util.Set;

/**
 * @ClassName: News
 * @Description: 新闻mapping属性
 */
public class News {

    public final static String ID = "id";//这个是新闻的唯一Id 可能回合预警的冲突
    public final static String MEDIA_LEVEL = "mediaLevel"; //媒体级别
    public final static String VIEW = "view";//阅读量
    public final static String MEDIA_NAME = "mediaName"; //媒体名称
    public final static String MEDIA_NAME_ZH = "mediaNameZh"; //媒体中文名称
    public final static String MEDIA_NAME_EN = "mediaNameEn"; //媒体的英文名称
    public final static String SENTIMENT_ID = "sentimentId";//情感ID 1 正0 中 -1 负 
    public final static String MEDIA_TYPE = "mediaType";//媒体类型
    public final static String MEDIA_T_NAME = "mediaTname";//媒体的标签名
    public final static String PROVINCE_ID = "provinceId";//省份ID
    public final static String PROVINCE_NAME_ZH = "provinceNameZh"; //省份的中文名称
    public final static String PROVINCE_NAME_EN = "provinceNameEn";//省份的引文名称
    public final static String DOMAIN_ID = "domainId";//领域ID 不对外没用
    public final static String DOMAIN = "domain"; //领域 不对外 没用
    public final static String TRANSFER = "transfer";// 这个是转发
    public final static String TAGID = "tagId";//标签Id
    public final static String TAG_NAME = "tagName";//标签名称
    public final static String LANGUAGE_CODE = "languageCode";//语言编号
    public final static String LANGUAGE_T_NAME = "languageTname"; //语言名称
    public final static String COUNTRY_ID = "countryId";//国家Id
    public final static String COUNTRY_NAME_ZH = "countryNameZh"; //国家中文名称
    public final static String COUNTRY_NAME_EN = "countryNameEn";//国家英文名称
    public final static String DISTRICT_NAME_ZH = "districtNameZh";//区域中文名称
    public final static String DISTRICT_NAME_EN = "districtNameEn";//区域英文名称
    public final static String PUBTIME = "pubtime";//创建时间  时间戳
    public final static String PUBDATE = "pubdate";//创建时间  yyyy-MM-dd HH:mm:ss
    public final static String TITLE = "title"; //标题
    public final static String TEXT = "text";//新闻内容
    public final static String EXCERPT = "excerpt";//摘要
    public final static String URL = "url";//单条新闻的连接地址
    public final static String CATEGORY_ID = "categoryId";//分类Id
    public final static String IS_WARNING = "isWarning";//是否预警
    public final static String TOPIC_TYPE = "topicType";//专题类型
    public final static String KEYWORDS = "keywords";//关键字
    public final static String TOPIC_ID = "topicId";//专题Id
    private static Set<String> fields;
    static {
        try {
            fields = new HashSet<>();
            Field[] clazzFields = News.class.getFields();
            for (Field clazzField : clazzFields) {
                fields.add(String.valueOf(clazzField.get(null)));
            }
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
    }

    public static Set<String> getFields() {
        return fields;
    }
}
